<!DOCTYPE html>
<html lang="zh-CN">
	<head>
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta charset="utf-8">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
		<title>物料管理系统 v1.0</title>
		<#include "inc/css.ftl">
	</head>
	<body>
		<div class="container-fluid no-skin">
			<div class="row">
			   <div class="logo"></div>
			   <div class="user-info">
				   <span>欢迎您，${(user.username)!''}(${(user.realname)!''})</span>
				   <span class="date">
					<strong id="Y"></strong>
					<strong id="MH"></strong>
					<strong id="td_keleyi_com"></strong>
					<strong id="D"></strong>
					<strong id="H"></strong>
					<strong id="M"></strong>
					<strong id="S"></strong>
					</span>
				   <a href="logout.jspx" class="btn btn-primary">退出系统</a>
			   </div>
			</div>
			<div class="row">
				<div class="sidebar reponsive">
					
				  <ul class="nav nav-list" style="top:0">
				  	<#list resources! as resource>
					<li class="">
					   <a href="${(resource.linkurl)!'#'}" class="dropdown-toggle">
		                  <i class="menu-icon fa ${(resource.style)!''}"></i>
		                  <span class="menu-text"> ${(resource.name)!'未知'} </span><b class="arrow fa fa-angle-down"></b>
		               </a>
		               <#if resource.subresources?size gt 0 >
		               <b class="arrow"></b>
		               <ul class="submenu">
		               <#list resource.subresources as subresource>
		               	 <li>
		               	 	<a href="${(subresource.linkurl)!'#'}" target="rightContent">
		               	 	<i class="ace-icon fa ${(subresource.style)!'fa-caret-right'}"></i>
		               	 	<span>${(subresource.name)!'未知'}</span>
		               	 	</a>
		               	 </li>
					  </#list>
		               </ul>
		               </#if>
					</li>
					</#list>
				</ul>
				
				<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
					<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
				</div>
			</div>
			<div class="main-content embed-responsive embed-responsive-16by9">
				<iframe class="embed-responsive-item" name="rightContent" id="main-content" src="${indexUrl!'about.jspx'}"></iframe>
			</div>
		</div>
		</div>
		<#include "inc/js.ftl">
		<script src="${request.contextPath}/static/asset/jqGrid/4.6.0/js/jquery.jqGrid.min.js"></script>
	<script>
	$(document).ready(function(){
	
		setInterval(showTime,1000);
		
		$(".nav-list li:first-child").addClass("active open");
		$("#sidebar-collapse").on("click",function(){
			var $sidebar = $(".sidebar");
			if($sidebar.hasClass("menu-min")){
				$sidebar.removeClass("menu-min");
				$(this).find("i").addClass("fa-angle-double-left").removeClass("fa-angle-double-right");
			}else{
				$sidebar.addClass("menu-min");
				$(this).find("i").removeClass("fa-angle-double-left").addClass("fa-angle-double-right");
			}
			var $frame = $(window.frames["rightContent"].document);
			
			var $grid = $frame.find("#gridTable");
			if($grid!==undefined){
				var parent_column = $grid.closest('[class*="row"]');
				$grid.jqGrid( 'setGridWidth', parent_column.width() );
				$frame.find("#gbox_gridTable").width(parent_column.width());
				$frame.find("#gview_gridTable").width(parent_column.width());
				$frame.find("#gridPager").width(parent_column.width());	
			}
		});
	});

	function showTime(){ 
		var today = new Date();
		var weekday=new Array(7)
		weekday[0]="星期日"
		weekday[1]="星期一"
		weekday[2]="星期二"
		weekday[3]="星期三"
		weekday[4]="星期四"
		weekday[5]="星期五"
		weekday[6]="星期六" 
		var y=today.getFullYear()+"年";
		var month=(today.getMonth()+1)+"月";
		var td_keleyi_com=today.getDate()+"日";
		var d=weekday[today.getDay()];
		var h=today.getHours()+":";
		var m=today.getMinutes()+":";
		var s=today.getSeconds(); 
		timer($("#Y"),y);
		timer($("#MH"),month); 
		timer($("#td_kel"+"eyi_com"),td_keleyi_com); 
		timer($("#D"),d);
		timer($("#H"),h);
		timer($("#M"),m);
		timer($("#S"),s);
		}
		
		function timer(obj,text){
			obj.text(text);
		}
	</script>
	</body>
</html>